/** * Next.js App Router catch-all route — stripe-mpp-proxy * * File: app/api/[[...path]]/route.ts * * Next.js passes Web-standard Request objects to route handlers, so * proxy.fetch works without any adapter — just re-export the handlers. * * Add to .env.local (see root .env.example for all variables). */ import { createProxy } from '../../../../../src/index.js' const proxy = createProxy({ stripe: { secretKey: process.env.STRIPE_SECRET_KEY!, networkId: process.env.STRIPE_NETWORK_ID ?? 'internal', }, services: { inference: { origin: process.env.INFERENCE_ORIGIN_URL!, routes: [ { method: 'POST', path: '/api/v1/infer', description: 'Single inference request', pricing: { stripe: { amount: '0.05', currency: 'usd' }, }, }, ], }, data: { origin: process.env.DATA_ORIGIN_URL!, routes: [ { method: 'GET', path: '/api/v1/records/*', pricing: { stripe: { amount: '0.01', currency: 'usd' }, }, }, ], }, }, }) export const { GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS } = proxy.nextjs()